package com.mashuai.utils.ztest.pb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mashuai.utils.toolkit.core.msDataSource.annotation.MsDataSource;
import com.mashuai.utils.ztest.pb.bean.MsUser;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MsUserMapper extends BaseMapper<MsUser> {

    //查询默认的主数据源信息
    @Select("select *from ms_user")
    List<MsUser> getDefDataSourceData();


    //通过@MsDataSource("db2")，切换到数据源10.44.2.3查询信息
    @MsDataSource("db2")
    @Select("select *from ms_user")
    List<MsUser> annotationChangeDataSourceDb2();


    //手动切换数据源，通过 MsDataSourceUtils.switchDataSource方法
    @Select("select *from ms_user")
    List<MsUser> manualChangeDataSourceDef();

}
